package com.star.modules.sys.base;

import com.star.modules.sys.enums.ResultEnum;
import com.star.modules.sys.excetion.ApiException;
import org.springframework.core.annotation.Order;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;



/**
 * 异常处理
 */
@RestControllerAdvice
@Order(1)
public class BaseExceptionHandler {

    @ExceptionHandler({ApiException.class})
    public Object systemHandler(Exception e) {
        return BizDataResult.createResult(ResultEnum.EROOR.getCode(),e.getMessage());
    }

}
